<!DOCTYPE html>
<html lang="en">

<head>
    <!-- BEGIN META -->
    {include file="public/meta"}
    <!-- END META -->

    <!-- BEGIN STYLESHEET-->
    {include file="public/css"}
    <!-- END STYLESHEET-->

    <title>
        {$current_menu['title']} - {$yun_config.title}
    </title>
</head>

<body>
<!-- BEGIN SECTION -->
<section id="container">
    <!-- BEGIN HEADER -->
    {include file="public/header"}
    <!-- END HEADER -->
    <!-- BEGIN SIDEBAR -->
    {include file="public/sidebar"}
    <!-- END SIDEBAR -->
    <!-- BEGIN MAIN CONTENT -->
    <section id="main-content">
        <!-- BEGIN WRAPPER  -->
        <section class="wrapper z-index-1">
            <!-- TOP MENU ROW  -->
            {include file="public/top_menu"}
            <!-- TOP MENU ROW  -->

            <!-- ADMINISTRATOR ROW  -->
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                            <span class="label label-primary">{$current_menu.title}</span>
                            <span class="tools pull-right"></span>
                        </header>
                        <div class="panel-body">
                            <!-- BEGIN DIV FORM -->
                            <div class="form navbar navbar-default">
                                <form class="form-horizontal col-sm-4" role="form" action="{:url('index')}" method="get">
                                    <div class="form-group m-bot0 m-top15">
                                        <div class="col-sm-10">
                                            <div class="input-group m-bot15">
                                                <input type="text" class="form-control" name="keyword" value="{$keyword}" placeholder="用户名">
                                                <span class="input-group-btn">
                                                    <button type="submit" class="btn btn-white">
                                                        <i class="fa fa-search"> 搜索</i>
                                                    </button>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <!-- END DIV FORM -->
                            <table class="table table-striped table-advance table-hover">
                                <thead>
                                <tr>
                                    <th class="text-center"><i class="fa fa-list"></i> ID</th>
                                    <th class="text-center"><i class="fa fa-user"></i> 用户名</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-users"></i> 所属权限组</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-male"></i> 性别</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-calendar"></i> 出生年月</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-phone"></i> 电话</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-linux"></i> QQ</th>
                                    <th class="text-center hidden-phone"><i class="fa fa-maxcdn"></i> 邮箱</th>
                                    <th class="text-center"><i class="fa fa-ban"></i> 状态 </th>
                                    <th class="text-center hidden-phone"><i class="fa fa-clock-o"></i> 创建时间 </th>
                                    <th class="text-center"><i class="fa fa-calendar-o"></i> 操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="list" id="item"}
                                <tr>
                                    <td class="text-center">{$item.admin_uid}</td>
                                    <td class="text-center">{$item.username}</td>
                                    <td class="text-center hidden-phone">{$item['group']['title']}</td>
                                    <td class="text-center hidden-phone">{$sex[$item.sex]}</td>
                                    <td class="text-center hidden-phone">{$item.birthday}</td>
                                    <td class="text-center hidden-phone">{$item.phone}</td>
                                    <td class="text-center hidden-phone">{$item.qq}</td>
                                    <td class="text-center hidden-phone">{$item.email}</td>
                                    <td class="text-center">
                                        {if condition="$item['status'] eq 0"}
                                        <span class="label label-danger">锁定</span>
                                        {else /}<span class="label label-success">正常</span>
                                        {/if}
                                    </td>
                                    <td class="text-center hidden-phone">{$item.create_time}</td>
                                    <td class="text-center">
                                        <a href="{:url('edit',['uid'=>$item.admin_uid])}" class="btn btn-primary btn-xs" title="修改">
                                            <li class="fa fa-pencil"></li>
                                        </a>
                                        {if condition="$item.admin_uid neq 1"}
                                        {if condition="$item.status eq 1"}
                                        <a val="{:url('lock',['uid'=>$item.admin_uid,'opt'=>'lock'])}" class="btn btn-warning btn-xs lock" title="锁定禁用"><li class="fa fa-lock"></li></a>
                                        {else /}
                                        <a val="{:url('lock',['uid'=>$item.admin_uid,'opt'=>'unlock'])}" class="btn btn-info btn-xs unlock" title="解除锁定"><li class="fa fa-unlock"></li></a>
                                        {/if}
                                        <a val="{:url('del',['uid'=>$item.admin_uid])}" class="btn btn-danger btn-xs del" title="删除">
                                            <li class="fa fa-trash-o"></li>
                                        </a>
                                        {/if}
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                            <!-- PAGE INFO ROW -->
                            <div class="text-right m-r-15">
                                {$list->render()|raw}
                            </div>
                            <!-- END PAGE INFO -->
                        </div>
                    </section>
                </div>
            </div>
            <!-- END ADMINISTRATOR ROW  -->
        </section>
        <!-- END WRAPPER -->
    </section>
    <!-- END MAIN CONTENT -->
    <!-- BEGIN FOOTER -->
    {include file="public/footer"}
    <!-- END FOOTER -->
</section>
<!-- END SECTION -->
<!-- BEGIN JS -->
{include file="public/js"}
<!-- INLINE JS RELATED TO THIS PAGE -->
<script type="text/javascript">
    $(function () {
        /**
         * 删除
         */
        $(".del").click(function () {
            var url = $(this).attr('val');
            layer.confirm('确定要删除此管理员用户吗？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                window.location.href = url;
            }, function () {
            });
        });

        /**
         * 锁定禁用
         */
        $(".lock").click(function () {
            var url = $(this).attr('val');
            layer.confirm('确定要锁定禁用此管理员用户吗？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                window.location.href = url;
            }, function () {
            });
        });

        /**
         * 解除
         */
        $(".unlock").click(function () {
            var url = $(this).attr('val');
            layer.confirm('确定要解除锁定此管理员用户吗？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                window.location.href = url;
            }, function () {
            });
        });
    });
</script>
<!-- END JS -->
</body>

</html>